/*
 * OrderParameter.h
 *
 *  Created on: Aug 2, 2012
 *      Author: koschke
 */

#ifndef ORDERPARAMETER_H_
#define ORDERPARAMETER_H_

#include <gsl/gsl_complex.h>
#include <votca/csg/csgapplication.h>
#include <votca/csg/nblistgrid.h>
#include "TypesAndTools.h"

using namespace votca::csg;

class OrderParameter {
public:
	OrderParameter(Topology * _top, BeadList * _beadList);
	virtual ~OrderParameter();
  /* define your order parameter in a derived class */
	virtual void Calculate() = 0;
  /* and adjust the output (if needed) */
	virtual void PrintInfo () = 0;
	void createNeighborMatrix(NBListGrid* _nbListGrid, Topology* _top,
			vector<vector<int> >* _neighborList);

	double getCutOff() const {
		return cutOff;
	}

	void setCutOff(double _cutOff) {
		cutOff = _cutOff;
		//(re)generate nblist
		nbListGrid->setCutoff(cutOff);
		nbListGrid->Generate(*beadList);
		createNeighborMatrix(nbListGrid, top, &neighborMatrix);
	}

  //TODO do I need this variable in all order parameters? 
	double getThreshold() const {
		return threshold;
	}

	void setThreshold(double threshold) {
		this->threshold = threshold;
	}

  //TODO why protected and not private?
protected:
	NBListGrid *nbListGrid;
	Topology * top;
	BeadList * beadList;

	vector<vector<int> > neighborMatrix;

	long solidParticles;
  //TODO these two should be in Localq.h, shouldn't they?
	lq_t *lq;
	vector<lq_t> lqVec;
	//double thresh;
private:
	double cutOff;
	double threshold;
};

#endif /* ORDERPARAMETER_H_ */
